package cn.kk.code;

import cn.kk.base.model.BaseEnum;
import lombok.Getter;

import java.util.Objects;

/**
 * @author kinoko
 */
@Getter
public enum SuccessCodeEnum implements BaseEnum<String> {

    SUCCESS("200", "OK");

    private final String code;
    private final String description;

    SuccessCodeEnum(String code, String description) {
        this.code = code;
        this.description = description;
    }

    public static SuccessCodeEnum get(String code) {
        for (SuccessCodeEnum baseEnum : values()) {
            if (Objects.equals(baseEnum.getCode(), code)) {
                return baseEnum;
            }
        }
        throw new IllegalArgumentException();
    }

}
